package com.ifnk.portaljava.dapWeb.pojo;

/**
 * 功能类
 */
import java.io.Serializable;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;

public class Module implements Serializable,Comparator {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7416156018931146409L;
	private int id;
	private String moduleName;
	private String url;
	private Set<Permission> permissionSet = new HashSet<Permission>();
	
	public int compare(Object o1, Object o2) {
		Module m1 = (Module) o1;
		Module m2 = (Module) o2;
		if(m1.getId() > m2.getId()){
			return 1;
		}else if(m1.getId() == m2.getId()){
			return 0;
		}else{
			return -1;
		}
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Set<Permission> getPermissionSet() {
		return permissionSet;
	}

	public void setPermissionSet(Set<Permission> permissionSet) {
		this.permissionSet = permissionSet;
	}

}
